﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
using Volo.Abp;

namespace Bridge.Wms.Domain
{
    [Comment("订单明细表")]
    [Table("t_voucher_orderdetail")]
    [Index(nameof(OrderId))]
    [Index(nameof(VoucherCode))]
    public class OrderDetail : AuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant
    {
        public OrderDetail() { }
        public OrderDetail(Guid id) 
        {
        this.Id = id;   
        }

        /// <summary>
        /// 订单ID
        /// </summary>
        [MaxLength(36)]
        [Comment("订单主表ID")]
       
        public Guid OrderId { get; set; }

        /// <summary>
        /// 单据编号
        /// </summary>
        [MaxLength(32)]
        [Comment("单据编号")]
        public string VoucherCode { get; set; }

        /// <summary>
        /// 行号
        /// </summary>
        [Comment("行号")]
        public int LineNo { get; set; }
        

        /// <summary>
        /// 产品编码
        /// </summary>
        [MaxLength(50)]
        [Comment("产品编码")]
        public string ProductCode { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        [MaxLength(100)]
        [Comment("产品名称")]
        public string ProductName { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        [Comment("单价")]
        [Column(TypeName = "decimal(10,4)")]
        public decimal Price { get; set; }

        /// <summary>
        /// 订单数量
        /// </summary>
        [Comment("订单数量")]
        [Column(TypeName = "decimal(10,2)")]
        public decimal OrderCount { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [MaxLength(10)]
        [Comment("单位")]
        public string Unit { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        [MaxLength(300)]
        [Comment("规格")]
        public string Specification { get; set; }

        /// <summary>
        /// 厂家ID
        /// </summary>
        [MaxLength(36)]
        [Comment("厂家Id")]
        public Guid ManufactureId { get; set; }

        /// <summary>
        /// 厂家名称
        /// </summary>
        [MaxLength(100)]
        [Comment("厂家名称")]
        public string ManufactureName { get; set; }
        /// <summary>
        /// 注册证号
        /// </summary>
        [MaxLength(30)]
        [Comment("注册证号")]
        public string RegisteredCardCode { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        [Comment("备注")]
        public string Remark { get; set; }

        /// <summary>
        /// 删除标识
        /// </summary>
        [Comment("删除标识")]
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 租户ID
        /// </summary>
        [Comment("租户ID")]
        public Guid? TenantId { get; set; }

      
    }
}
